Psst: Open the JavaScript Console and try to play around with these functions:
const maxHeap = new MaxBinaryHeap()
maxHeap.insert(41).insert(39).insert(33).insert(18).insert(27).insert(12).insert(55)
// should return heap with values [55, 39, 41, 18, 27, 12, 33]
maxHeap.extractMax() // should return 55
const minHeap = new MinBinaryHeap()
minHeap.insert(41).insert(39).insert(33).insert(18).insert(27).insert(12).insert(55)
// should return heap with values [12, 27, 18, 41, 33, 39, 55]
minHeap.extractMin() // should return 12
const queue = new PriorityQueue() // Uses Min heap, meaning lower
priority number gets served first
queue.enqueue("Wood Tier", 41).enqueue("Bronze Tier",
39).enqueue("Silver Tier", 33).enqueue("Diamond Tier",
18).enqueue("Gold Tier", 27).enqueue("Ultra Deluxe VIP",
12).enqueue("pleb", 55)
queue.dequeue()
heapSort([9,0,7,3,4,6,8,2,1,5]) // should return
[0,1,2,3,4,5,5,6,7,8,9]